# myapp.rb
require 'sinatra'
require 'puma'
set :port => 8080
set :hostname => "0.0.0.0"
set :environment => "development"
=begin
https://sinatrarb.com/intro.html
=end
get '/' do
  'Hello world!'
end

get '/hello/:name' do
  # matches "GET /hello/foo" and "GET /hello/bar"
  # params['name'] is 'foo' or 'bar'
  "Hello #{params['name']}!"
end
# get '/hello/:name' do |n|
#   # matches "GET /hello/foo" and "GET /hello/bar"
#   # params['name'] is 'foo' or 'bar'
#   # n stores params['name']
#   "Hello #{n}!"
# end
get '/say/*/to/*' do
  # matches /say/hello/to/world
  params['splat'] # => ["hello", "world"]
end